package scene.scenegraph;

import java.util.Stack;

import util.Matrix4f;

public class TransformNode extends SceneGraphNode{
	
	protected Matrix4f transformation;
	
	public TransformNode(Matrix4f transformationMatrix, SceneGraphNode parent){
		super(parent);
		this.transformation = transformationMatrix;
	}

	@Override
	public NodeType getType() {
		return NodeType.TRANSFORM;
	}
	
	public Matrix4f getMatrix(){
		return transformation;
	}

	@Override
	public void traverse(Stack<Matrix4f> stack) {
		stack.push(transformation);
		for(SceneGraphNode node : children){
			node.traverse(stack);
		}
		stack.pop();
	}

}
